function a() {
    console.log(1)
    Promise.resolve().then(() => {
        console.log(2)
    })
}


setTimeout(() => {
    console.log(3)
    Promise.resolve().then(a)
}, 0);


Promise.resolve().then(() => {
    console.log(4)
})


console.log(5)